//
//  Array+Extension.swift
//  Backhome
//
//  Created by vbn on 2018/8/10.
//  Copyright © 2018年 SmartHome. All rights reserved.
//

import Foundation

extension Array where Element: Equatable {
    public func KNLoopNext(_ current: Element) -> Element {
        var index = self.index(self.index(of: current) ?? 0, offsetBy: 1)
        if index == self.count {
            index = 0
        }
        return self[index]
    }
    
}
